Interview Questions and Answer
Options:
a. Form Method must be POST
b. Form Method must be GET
c. Form must have attribute enctype="multipart/form-data"
d. Form must have attribute enctype="plain/text"
Reveal Answer
Options:
a. FormMethod.Post as parameter.
b. HttpPostedFileBase as parameter.
c. Forms Collection as parameter.
d. HttpFileBase as parameter
Reveal Answer
Options:
a. Name and Value pair of different input elements is submitted to server irrespective of their state.
b. Reset and Button input elements, name and value pair are not submitted to server.
c. If checkbox is unchecked, name of checkbox and empty value is submitted
d. All submit buttons name and value is submitted
Reveal Answer
Options:
a. DefaultModelBinder converts Form values and route data into objects
b. All name-value pairs submitted by browser MUST be used as parameter of Action Method
c. Some of submitted form values and route data are used as parameters for the action method.
d. When the form is submitted, no two elements must have same name else it gives runtime error.
Reveal Answer
Options:
a. Primitive types like int, double, string etc
b. Custom Objects like Employee or Department
c. A collection such as IEnumerable, ICollection
Reveal Answer
Options:
a. public ActionResult Index(string name, bool isActive, string qualification)
b. public ActionResult Index(string name, string isActive, string [] qualification)
c. public ActionResult Index(string name, bool isActive, string[] qualification)
d. public ActionResult Index(string name, string isActive, string qualification)
Reveal Answer
Options:
a. [HttpPost] public ActionResult Index() { }
b. [HttpGet] public ActionResult Index() { }
c. public ActionResult Index() { }
d. private ActionResult Index(FormCollection fc) { }
Reveal Answer
Options:
a. [HttpPost][HttpGet]public ActionResult Index() { }
b. [AcceptVerb(HttpGet | HttpPost)] public ActionResult Index() { }
c. [AcceptVerb(HttpGet | HttpPost)] public ActionResult Index() { }
d. [AcceptVerb(HttpVerb.Get | HttpVerb.Post)] public ActionResult Index() { }
Reveal Answer
Options:
a. Bind attribute is used to control how a request data is used in model object initialization.
b. Bind attribute can be used only with parameters of action method.
c. Bind attribute can be used to specify the properties of an object which should not be initialized even if values are available in browser request.
d. None of the above
Reveal Answer
Options:
a. public ActionResult GetEmployeeDetails([Bind(Exclude="ID")]Employee emp)
b. public ActionResult GetEmployeeDetails([Bind(Exclude="ID","Name")]Employee emp)
c. public ActionResult GetEmployeeDetails([Bind(Exclude(ID))]Employee emp)
d. public ActionResult GetEmployeeDetails([Bind(Exclude="ID"),Bind(Exclude="Name")]Employee emp)
Reveal Answer
Options:
a. It should be used for creating a Model object
b. It should be used for intializing an already existing model object with data from browser request
c. It doesn’t throws exception even if the validation of Model object fails.
d. It can be used only in ActionMethods having verb as HttpPost
Reveal Answer
Options:
a. Add the following to Application_Start in global.asax ModelBinders.Binders.Add(typeof(ModelType), new CustomModelBinder());
b. Add the ModelBinder Attribute to the controller
c. Add the ModelBinder Attribute to the ActionMethod
d. Add the ModelBinder Attribute to the Model parameter of an action method
Reveal Answer
Bestdotnet google plus